Mule : Pop3 Provider
This page last changed on Apr 27, 2006 by rossmason.
The Pop3 transport provider can be used to for receiving messages from POP3 inboxes and connecting to POP3 mailboxes using SSL (POP3s) using the javax.mail api. The javadoc for this provider can be found here. org.mule.providers.email.Pop3Connector. Pop3 Connector Properties
Pop3s Connector PropertiesThe Pop3s Connector enables Pop3 over SSL using the javax.mail APIs. It supports all the properties of the Pop3 connector and has some additional properties for setting up an SSL connection.
When using the Pop3s Connector the default port is set to 995. Pop3(s) EndpointsPop3 endpoints describe details about the connecting to a Pop3 mailbox. Pop3 URIs use the following syntax - pop3://<user:password>@<pop3 server>[:port][?params] The format is the same for POP3s - pop3s://<user:password>@<pop3 server>[:port][?params]
For example to connect to a Google gmail box you need to use POP3s, pop3s://muletestbox:[email protected]?checkFrequency=30000 This will log into the muletestbox mailbox on pop.gmail.com using password 123456 (using default POP3s port) and will check the mailbox for new messages every 30 seconds. To set additional properties on the endpoint, you can set them as parameters on the URI but we recommend you set them as endpoint properties to make it easier to read and maintain the configuration. <endpoint address="pop3s://username:[email protected]"> <properties> <property name="checkFrequency" value="120000"/> <property name="trustStore" value="./trustore"/> <property name="trustStorePassword" value="trustNoOne"/> </properties> </endpoint> FiltersFilters can be set on an endpoint to filter out any unwanted messages. The Mail transport provider has a couple of Email filters that can either be used directly or extended to implement custom filtering rules.
Configuring FiltersThe following demonstrates to only accept messages where the email subject starts with [mule] - <endpoint address="pop3s://username:[email protected]"> <filter className="org.mule.providers.email.filters.MailSubjectRegExFilter" pattern="\\[mule\\](.*)"/> <properties> <property name="checkFrequency" value="120000"/> <property name="trustStore" value="./trustore"/> <property name="trustStorePassword" value="trustNoOne"/> </properties> </endpoint> TransformersThere are a couple of transformers provided with the Email transport that are useful for converting javax.mail.Message to Mule event payloads. These transformers will extract the message body and properties (including headers) and handle attachments too. If you need to customise the behaviour of these transformers it is recommended that you extends the existing transformers rather than re-implement them.
|
Document generated by Confluence on Nov 27, 2006 10:27 |